<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	  <head>
	    <base href="<%=basePath%>">
	    <title>add_room.jsp</title>
	    
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">    
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		
		<link rel="stylesheet" type="text/css" href="./css/style.css">
	  </head>
	  
	  <body>
		    <div id="blue_button"><div id="blue_button_word">&nbsp;机房配置</div></div>
		  	<div id="right_background">&nbsp;<br/> <br/> 
				<form action="./room/EditRoomAction" method="post">
					<table cellpadding="10" cellspacing="10" border="0" align="center">
						<tr align="right">
							<td>机房ID:</td>
							<td><input type="text" id="roomId" name="roomId" value="${room.roomId}" readonly/></td>
							<td>机房名称:</td>
							<td><input type="text" id="roomName" name="roomName" value="${room.roomName}"/></td>
						</tr>
						<tr align="right">
							<td>负责人:</td>
							<td>
								<select id="roomManager" name="roomManager" style="width:154px;height:22px;">
									<option id="0" value=""></option>
									<c:forEach items="${empList}" var="e">
										<option id="${e.EId}" value="${e.EId}" 
											<c:if test="${e.EId==room.comEmp.EId}">selected="selected"</c:if>
										>
											${e.EName}
										</option>
									</c:forEach>
								</select>
							</td>
							<td>联系电话:</td>
							<td><input type="text" id="roomPhone" name="roomPhone" value="${ room.roomPhone}"/></td>
						</tr>
						<tr align="right">
							<td>所属部门:</td>
							<td>
								<select id="roomDept" name="roomDept" style="width:154px;height:22px;" >
									<option id="0" value=""></option>
									<c:forEach items="${deptList}" var="d">
										<option id="${d.deptno}" value="${d.deptno}" 
											<c:if test="${d.deptno==room.comDept.deptno}">selected="selected"</c:if>
										>
											${d.dname}
										</option>
									</c:forEach>
								</select>
							</td>
							<td>机房地址:</td>
							<td><input type="text" id="roomAddress" name="roomAddress" value="${room.roomAddress}"/></td>
						</tr>
						<tr>
							<td>机房备注:</td>
							<td colspan="3">
								<textarea id="roomDescribe" name="roomDescribe" rows="3" cols="40" >${room.roomDescribe}</textarea>
							</td>
						</tr>
					</table>
					<div align="center">
						<input type="submit" class="add" value="提交" /> &nbsp;&nbsp;
						<input type="button" class="add" value="重置" 
							onclick="location.href='./room/ShowEditRoomAction?id=${room.roomId}'"/>&nbsp;&nbsp;
						<input type="button" class="add" value="返回" 
							onclick="location.href='./room/RoomListAction'"/> 
					</div><br>
					<div align="center">
						<font id="msg" color="red">${msg}</font>
					</div>
				</form>
		  	</div>
	  </body>
</html>
